package com.xinyi.shicihui.controller;

import com.xinyi.shicihui.dao.CategoryDao;
import com.xinyi.shicihui.pojo.entity.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xinyi
 * @desc 分类信息管理接口
 * @date 2022/1/21
 */
@RestController
@RequestMapping("/api/v1/category")
public class CategoryController {

    @Autowired
    private CategoryDao categoryDao;

    @GetMapping("/all")
    public List<Category> all(){
        return categoryDao.findAll();
    }
}
